//src/main/java/com/cuit/blog/service/ReplyService.java1
package com.cuit.blog.service;

import com.cuit.blog.dao.ReplyRespository;
import com.cuit.blog.entity.Reply;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReplyService {

    @Autowired
    ReplyRespository replyRespository;

    public List<Reply> findAll(){return replyRespository.findAll();}
    public void save(Reply reply) {
        replyRespository.save(reply);
    }
    public Reply findById(int id) {
        return replyRespository.findById(id).orElse(new Reply());
    }

    public void deleteById(int id) {
        replyRespository.deleteById(id);
    }
}
